#include "accountbuddy.h"


namespace Account {


Buddy::Buddy(qint64 id, QObject *parent) :
    Member(id, parent),
    m_lastContactTime(0)
{
}


Buddy::Buddy(const Profile::ProfileData &profile,
             QObject *parent)
    : Member(profile, parent)
{
    m_lastContactTime = 0;
}


Member::MemberType Buddy::type() const
{
    return Member::BuddyType;
}


void Buddy::setLastContactTime(qint64 time)
{
    m_lastContactTime = time;
    emit lastContactTimeSet(this);
}


qint64 Buddy::lastContactTime() const
{
    return m_lastContactTime;
}


void Buddy::updateLastContactTime(qint64 time)
{
    if (m_lastContactTime == time)
        return;

    m_lastContactTime = time;
    emit lastContactTimeUpdated(this);
    emit dataChanged(this);
}

} // namespace Account
